import request from '@/utils/request'

// 获取设备List
// 废弃
export function getGmDevice(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice?current=${data.current}&size=${data.size}&appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&version=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 新增用户折线图
export function getNewUserAddCountByDeviceModel(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/getNewUserAddCountByDeviceModel?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 启动次数折线图
export function getStartUpCountInDeviceModel(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/getStartUpCountInDeviceModel?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 新增用户折线图(操作系统)
export function getNewUserAddCountByDeviceOS(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/getNewUserAddCountByDeviceOS?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}

// 启动次数折线图(操作系统)
export function getStartUpCountInDeviceOS(data) {
  let url = '';
	let baseUrl = `${process.env.VUE_APP_BASE_API}/gmDevice/getStartUpCountInDeviceOS?appKey=${data.appKey}&startDate=${data.startDate}&endDate=${data.endDate}`;
	url = baseUrl + (data.channel ? ('&channel=' + data.channel) : ('')) + (data.version ? ('&appVersion=' + data.version) : (''))
  return request({
    url,
    method: 'get',
    headers: {
      'Content-Type': 'x-www-form-urlencoded'
    }
  })
}